.class Lcom/xingbook/service/download/h;
.super Ljava/lang/Object;

# interfaces
.implements Lcom/xingbook/service/download/m;


# instance fields
.field final synthetic a:Lcom/xingbook/service/download/DownloadService;


# direct methods
.method constructor <init>(Lcom/xingbook/service/download/DownloadService;)V
    .locals 0

    iput-object p1, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public a(Ljava/lang/String;I)V
    .locals 6

    const/4 v2, 0x5

    const/4 v4, 0x3

    iget-object v0, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    invoke-virtual {v0, p1}, Lcom/xingbook/service/download/DownloadService;->a(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_1

    invoke-virtual {p0, p1}, Lcom/xingbook/service/download/h;->a_(Ljava/lang/String;)V

    :cond_0
    :goto_0
    return-void

    :cond_1
    iget-object v0, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    iget-object v0, v0, Lcom/xingbook/service/download/DownloadService;->d:Lcom/xingbook/service/download/l;

    invoke-virtual {v0, p1}, Lcom/xingbook/service/download/l;->a(Ljava/lang/String;)Lcom/xingbook/service/download/k;

    move-result-object v0

    if-eqz v0, :cond_0

    invoke-virtual {v0, p2}, Lcom/xingbook/service/download/k;->a(I)V

    if-ne p2, v2, :cond_2

    iget-object v1, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    iget-object v1, v1, Lcom/xingbook/service/download/DownloadService;->d:Lcom/xingbook/service/download/l;

    invoke-virtual {v1, p1}, Lcom/xingbook/service/download/l;->b(Ljava/lang/String;)Z

    :cond_2
    if-eq p2, v2, :cond_3

    const/4 v1, 0x4

    if-eq p2, v1, :cond_3

    const/4 v1, 0x6

    if-ne p2, v1, :cond_4

    :cond_3
    iget-object v1, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    iget-object v1, v1, Lcom/xingbook/service/download/DownloadService;->c:Ljava/util/HashMap;

    invoke-virtual {v1, p1}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    :cond_4
    iget-object v1, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    iget-object v1, v1, Lcom/xingbook/service/download/DownloadService;->b:Landroid/os/Messenger;

    if-eqz v1, :cond_6

    :try_start_0
    iget-object v1, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    iget-object v1, v1, Lcom/xingbook/service/download/DownloadService;->b:Landroid/os/Messenger;

    const/4 v2, 0x0

    const/4 v3, 0x3

    if-ne p2, v4, :cond_5

    invoke-virtual {v0}, Lcom/xingbook/service/download/k;->c()J

    move-result-wide v4

    long-to-int v0, v4

    :goto_1
    invoke-static {v2, v3, p2, v0, p1}, Landroid/os/Message;->obtain(Landroid/os/Handler;IIILjava/lang/Object;)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {v1, v0}, Landroid/os/Messenger;->send(Landroid/os/Message;)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    goto :goto_0

    :cond_5
    const/4 v0, 0x0

    goto :goto_1

    :cond_6
    iget-object v0, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    iget-object v0, v0, Lcom/xingbook/service/download/DownloadService;->c:Ljava/util/HashMap;

    invoke-virtual {v0}, Ljava/util/HashMap;->size()I

    move-result v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    iget-object v0, v0, Lcom/xingbook/service/download/DownloadService;->a:Ljava/util/HashMap;

    invoke-virtual {v0}, Ljava/util/HashMap;->values()Ljava/util/Collection;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_2
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-nez v0, :cond_7

    iget-object v0, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    iget-object v0, v0, Lcom/xingbook/service/download/DownloadService;->d:Lcom/xingbook/service/download/l;

    invoke-virtual {v0}, Lcom/xingbook/service/download/l;->a()V

    iget-object v0, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    invoke-virtual {v0}, Lcom/xingbook/service/download/DownloadService;->stopSelf()V

    goto :goto_0

    :cond_7
    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/concurrent/ExecutorService;

    invoke-interface {v0}, Ljava/util/concurrent/ExecutorService;->shutdown()V

    goto :goto_2
.end method

.method public a_()V
    .locals 6

    iget-object v0, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    iget-object v0, v0, Lcom/xingbook/service/download/DownloadService;->b:Landroid/os/Messenger;

    if-eqz v0, :cond_0

    :try_start_0
    iget-object v0, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    iget-object v0, v0, Lcom/xingbook/service/download/DownloadService;->b:Landroid/os/Messenger;

    const/4 v1, 0x0

    const/4 v2, 0x0

    const/4 v3, 0x0

    const/4 v4, 0x0

    iget-object v5, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    invoke-virtual {v5}, Lcom/xingbook/service/download/DownloadService;->a()Ljava/util/Collection;

    move-result-object v5

    invoke-static {v1, v2, v3, v4, v5}, Landroid/os/Message;->obtain(Landroid/os/Handler;IIILjava/lang/Object;)Landroid/os/Message;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/os/Messenger;->send(Landroid/os/Message;)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    :cond_0
    :goto_0
    return-void

    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public a_(Ljava/lang/String;)V
    .locals 5

    iget-object v0, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    iget-object v0, v0, Lcom/xingbook/service/download/DownloadService;->d:Lcom/xingbook/service/download/l;

    invoke-virtual {v0, p1}, Lcom/xingbook/service/download/l;->a(Ljava/lang/String;)Lcom/xingbook/service/download/k;

    move-result-object v0

    invoke-virtual {v0}, Lcom/xingbook/service/download/k;->i()Ljava/io/File;

    move-result-object v0

    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result v1

    if-eqz v1, :cond_0

    invoke-virtual {v0}, Ljava/io/File;->delete()Z

    :cond_0
    iget-object v0, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    iget-object v0, v0, Lcom/xingbook/service/download/DownloadService;->d:Lcom/xingbook/service/download/l;

    invoke-virtual {v0, p1}, Lcom/xingbook/service/download/l;->b(Ljava/lang/String;)Z

    iget-object v0, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    iget-object v0, v0, Lcom/xingbook/service/download/DownloadService;->e:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    iget-object v0, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    iget-object v0, v0, Lcom/xingbook/service/download/DownloadService;->b:Landroid/os/Messenger;

    if-eqz v0, :cond_1

    :try_start_0
    iget-object v0, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    iget-object v0, v0, Lcom/xingbook/service/download/DownloadService;->b:Landroid/os/Messenger;

    const/4 v1, 0x0

    const/4 v2, 0x2

    const/4 v3, 0x0

    const/4 v4, 0x0

    invoke-static {v1, v2, v3, v4, p1}, Landroid/os/Message;->obtain(Landroid/os/Handler;IIILjava/lang/Object;)Landroid/os/Message;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/os/Messenger;->send(Landroid/os/Message;)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    :cond_1
    :goto_0
    return-void

    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public b(Ljava/lang/String;I)V
    .locals 6

    iget-object v0, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    iget-object v0, v0, Lcom/xingbook/service/download/DownloadService;->b:Landroid/os/Messenger;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    iget-object v0, v0, Lcom/xingbook/service/download/DownloadService;->d:Lcom/xingbook/service/download/l;

    invoke-virtual {v0, p1}, Lcom/xingbook/service/download/l;->a(Ljava/lang/String;)Lcom/xingbook/service/download/k;

    move-result-object v0

    if-nez v0, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    :try_start_0
    iget-object v1, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    iget-object v1, v1, Lcom/xingbook/service/download/DownloadService;->b:Landroid/os/Messenger;

    const/4 v2, 0x0

    const/4 v3, 0x4

    invoke-virtual {v0}, Lcom/xingbook/service/download/k;->d()J

    move-result-wide v4

    long-to-int v0, v4

    invoke-static {v2, v3, p2, v0, p1}, Landroid/os/Message;->obtain(Landroid/os/Handler;IIILjava/lang/Object;)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {v1, v0}, Landroid/os/Messenger;->send(Landroid/os/Message;)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public b_(Ljava/lang/String;)V
    .locals 3

    iget-object v0, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    iget-object v0, v0, Lcom/xingbook/service/download/DownloadService;->b:Landroid/os/Messenger;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    iget-object v0, v0, Lcom/xingbook/service/download/DownloadService;->d:Lcom/xingbook/service/download/l;

    invoke-virtual {v0, p1}, Lcom/xingbook/service/download/l;->a(Ljava/lang/String;)Lcom/xingbook/service/download/k;

    move-result-object v0

    if-nez v0, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    :try_start_0
    iget-object v0, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    iget-object v0, v0, Lcom/xingbook/service/download/DownloadService;->b:Landroid/os/Messenger;

    const/4 v1, 0x0

    const/4 v2, 0x6

    invoke-static {v1, v2, p1}, Landroid/os/Message;->obtain(Landroid/os/Handler;ILjava/lang/Object;)Landroid/os/Message;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/os/Messenger;->send(Landroid/os/Message;)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public c(Ljava/lang/String;I)V
    .locals 4

    iget-object v0, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    iget-object v0, v0, Lcom/xingbook/service/download/DownloadService;->d:Lcom/xingbook/service/download/l;

    invoke-virtual {v0, p1}, Lcom/xingbook/service/download/l;->a(Ljava/lang/String;)Lcom/xingbook/service/download/k;

    move-result-object v0

    if-nez v0, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    const/4 v1, 0x6

    invoke-virtual {v0, v1}, Lcom/xingbook/service/download/k;->a(I)V

    iget-object v0, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    iget-object v0, v0, Lcom/xingbook/service/download/DownloadService;->c:Ljava/util/HashMap;

    invoke-virtual {v0, p1}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v0, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    iget-object v0, v0, Lcom/xingbook/service/download/DownloadService;->b:Landroid/os/Messenger;

    if-eqz v0, :cond_0

    :try_start_0
    iget-object v0, p0, Lcom/xingbook/service/download/h;->a:Lcom/xingbook/service/download/DownloadService;

    iget-object v0, v0, Lcom/xingbook/service/download/DownloadService;->b:Landroid/os/Messenger;

    const/4 v1, 0x0

    const/4 v2, 0x5

    const/4 v3, 0x0

    invoke-static {v1, v2, p2, v3, p1}, Landroid/os/Message;->obtain(Landroid/os/Handler;IIILjava/lang/Object;)Landroid/os/Message;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/os/Messenger;->send(Landroid/os/Message;)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    goto :goto_0
.end method
